<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Responsive Bootstrap Advance Admin Template</title>

    <!-- BOOTSTRAP STYLES-->
    <link href="/myshop/public/admin/assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME STYLES-->
    <link href="/myshop/public/admin/assets/css/font-awesome.css" rel="stylesheet" />
       <!--CUSTOM BASIC STYLES-->
    <link href="/myshop/public/admin/assets/css/basic.css" rel="stylesheet" />
    <!--CUSTOM MAIN STYLES-->
    <link href="/myshop/public/admin/assets/css/custom.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/myshop/public/admin/assets/js/jquery.datetimepicker.css"/>
    <!-- GOOGLE FONTS-->
    <!-- <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' /> -->
    <style type="text/css">
  .error{color:red;}
  .custom-date-style {
    background-color: red !important;
}
</style>
</head>

<body>

<!--头部区块  -->


    <div id="wrapper">
        <nav class="navbar navbar-default navbar-cls-top " role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">COMPANY NAME</a>
            </div>

            <div class="header-right">

                <a href="message-task.html" class="btn btn-info" title="New Message"><b>30 </b><i class="fa fa-envelope-o fa-2x"></i></a>
                <a href="message-task.html" class="btn btn-primary" title="New Task"><b>40 </b><i class="fa fa-bars fa-2x"></i></a>
                <a href="login.html" class="btn btn-danger" title="Logout"><i class="fa fa-exclamation-circle fa-2x"></i></a>

            </div>
        </nav>
        <!-- /. NAV TOP  -->
        <nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">
                    <li>
                        <div class="user-img-div">
                            <img src="/myshop/public/admin/assets/img/user.png" class="img-thumbnail" />

                            <div class="inner-text">
                                Jhon Deo Alex
                            <br />
                                <small>Last Login : 2 Weeks Ago </small>
                            </div>
                        </div>

                    </li>


                    <li>
                        <a class="active-menu" href="index.html"><i class="fa fa-dashboard "></i>Dashboard</a>
                    </li>
                   
                   
                    <?php if(is_array($top_nav)): foreach($top_nav as $key=>$v): ?><li>
                        <a href="#"><i class="fa <?php echo ($v["icon"]); ?> "></i><?php echo ($v["name"]); ?> <span class="fa arrow"></span></a>
                         <ul class="nav nav-second-level">
                             <?php if(is_array($child_nav)): foreach($child_nav as $key=>$vo): if(($v['id']) == $vo['pid']): ?><li>
                                <a href="<?php echo U($vo['url']);?>"><i class="fa <?php echo ($vo["icon"]); ?> "></i><?php echo ($vo["name"]); ?></a><?php endif; ?>
                            </li><?php endforeach; endif; ?>
                             
                           
                        </ul>
                    </li><?php endforeach; endif; ?>
                    
                   
                    <li>
                        <a href="#"><i class="fa fa-sitemap "></i>Multilevel Link <span class="fa arrow"></span></a>
                         <ul class="nav nav-second-level">
                            <li>
                                <a href="#"><i class="fa fa-bicycle "></i>Second Level Link</a>
                            </li>
                             <li>
                                <a href="#"><i class="fa fa-flask "></i>Second Level Link</a>
                            </li>
                            <li>
                                <a href="#">Second Level Link<span class="fa arrow"></span></a>
                                <ul class="nav nav-third-level">
                                    <li>
                                        <a href="#"><i class="fa fa-plus "></i>Third Level Link</a>
                                    </li>
                                    <li>
                                        <a href="#"><i class="fa fa-comments-o "></i>Third Level Link</a>
                                    </li>

                                </ul>

                            </li>
                        </ul>
                    </li>
                   
                    
                </ul>

            </div>

        </nav>
             <div id="page-wrapper">
            <div id="page-inner">
                <div class="row">
                   
                </div>
                <!-- /. ROW  -->
                
                <!-- /. ROW  -->

               


                        <br />

<!-- 可变区域 -->

   
<div class="panel panel-danger">

                        <div class="panel-heading">
                           添加员工
                        </div>
                        <div class="panel-body">
                            <form id="signupForm" role="form" action="" method="post" enctype="multipart/form-data">
                                         

                                 <div class="form-group">
                                            <label>姓名</label>
                                            <input type="text" class="form-control" name="username">
                                            
                                    
                                        </div>
                                            <div class="form-group">
                                            <label>密码</label>
                                            <input type="password" name="password" class="form-control">
                                    
                                        </div>
                                <div class="form-group">
                                            <label>确认密码</label>
                                            <input id="cpassword" type="password" name="cpassword" class="form-control">
                                    
                                        </div>
                                 <div class="form-group">
                                            <label>邮箱</label>
                                            <input type="text" class="form-control" name="email">
                                    
                                        </div>
                                 <div class="form-group">
                                            <label>年龄</label>
                                            <input type="text" class="form-control" name="age">
                                    
                                        </div>
                                 <div class="form-group">
                                            <label>QQ</label>
                                            <input type="text" class="form-control" name="QQ">
                                    
                                        </div>
                                  <div class="form-group">
                                            <label>所属角色 ：</label>
                                            <select name="group_id">
                                            <option>请选择角色</option>
                                           <?php if(is_array($group)): foreach($group as $key=>$vo): ?><option value="<?php echo ($vo["id"]); ?>"><?php echo ($vo["title"]); ?></option><?php endforeach; endif; ?>

                                            </select>
                                        </div>
                                 
                                 <div class="form-group">
                                            <label>地址</label>
                                            <input type="text" class="form-control" name="adrees">
                                    
                                        </div>
                                 <!--  <div class="form-group">
                                            <label>所属角色 ：</label>
                                            <select name="role">
                                            <option value="0">请选择位置</option>
                                            <option value="1">头部</option>
                                            <option value="2">中间</option>
                                            <option value="3">底部</option>
                                            <option value="">无</option>

                                            </select>
                                        </div> -->
                                <div class="form-group">
                                            <label>手机号</label>
                                            <input type="text" class="form-control tel" name="tel">
                                            <label>短信验证码</label>
                                            <input type="button" name="send"  id="code" value="发送验证码">
                                             <input type="text" name="msg">
                                    
                                        </div>
                               
                                 <div class="form-group">
                                             <label>性别 ：</label>

                                           <label> <input type="radio" name="sex" value="1"> 男</label>

                                            <label> <input type="radio" name="sex" value="0"> 女</label>
                                            <input type="hidden" name="">
                                            
                                        </div>
                               
                                 <div class="form-group">
                                            <label>头像：</label>
                                            <input type="file" class="form-control" name="file" multiple>
                                    
                                        </div>
                                 
                                 
                                        <button class="btn btn-info" type="submit">确定 </button>

                                    </form>
                            </div>
                        </div>




<block name="js">


<script type="text/javascript" src="/myshop/public/admin/assets/js/jquery-3.0.0.min.js"></script>
<script type="text/javascript">
$(function(){

     

    $('.text-center i').click(function(){
      var icon = $(this).text();
      $('.icon').val(icon);


    })



})



</script>














    <div id="footer-sec">
        &copy; 2014 YourCompany | More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>
    </div>

  
    <!-- /. FOOTER  -->
    <!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
    <!-- JQUERY SCRIPTS -->
    <script src="/myshop/public/admin/assets/js/jquery-1.10.2.js"></script>
    <!-- BOOTSTRAP SCRIPTS -->
    <script src="/myshop/public/admin/assets/js/bootstrap.js"></script>
    <!-- METISMENU SCRIPTS -->
    <script src="/myshop/public/admin/assets/js/jquery.metisMenu.js"></script>
       <!-- CUSTOM SCRIPTS -->
    <script src="/myshop/public/admin/assets/js/custom.js"></script>
    

  <!-- 尾巴区域 -->

</body>
</html>

<script  src="/myshop/public/admin/assets/js/jquery.validate.min.js"></script>
<script type="text/javascript">

$(function(){

// alert(1111)
// 在键盘按下并释放及提交后验证提交表单
  $("#signupForm").validate({
       // debug:true,//只验证，不提交
       // 验证规则
        rules: {
            // 'username':'required',  //必填验证 
            'username': {
                required:true,//必填
                maxlength:10,//最多10位
                minlength:4,//至少4位
                },
            'password':{
                required:true,//必填
                equalTo:"#cpassword",//值相同

            },
            'sex':'required',
        },
        // 错误信息描述
        messages: {

            // username:'请输入帐号',
         
          username: {
            required: "请输入用户名",
            maxlength:"用户名最多10位",
            minlength: "用户名至少4位",
             },
          password:{
            required: "请输入密码",
            equalTo:"密码不一致",

         },
         sex:'请选择性别',
       },
       errorClass:'error',
    })
})


// 验证码计时器
var s=5;
var time=0;
$('#code').click(function(){
 
   var code= $(this);
   var tel = $('.tel').val();
   // alert(tel);

$.ajax({
     url:"<?php echo U('admin/ajax/send_sms');?>",
     type:'post',
     data:{
      'tel':tel,
     },
     success:function(code){
      // alert(code);
      if(code>0){
        alert( '验证码发送成功');
      }else{
        alert('验证码发送失败请稍候重试');
      }
     },


   })
time = setInterval(function(){

if(s>0){
    var txt = s+'s后重新发送';
    
    code.val(txt);
   code.prop('disabled',true);
   s--;
   
}else{
    s=5;
     var txt = '发送验证码';
    code.val(txt);
    code.prop('disabled',false);

    clearInterval(time);
}

  },1000);
    


})





</script>